<?php $user = App\Models\User::find($token['user_id']);?>
<nav id="sidebar" class="navbar-default navbar-static-side" role="navigation">
	<div class="sidebar-collapse">
		<ul id="side-menu" class="nav">
			<li class="nav-header">
				<div class="dropdown profile-element">
					<span>
						<img alt="image" class="img-circle" src="{{get_avatar(session('token')['user_id'])}}" width="50" />
					</span>
					<a data-toggle="dropdown" class="dropdown-toggle" href="javascript:;">
						<span class="clear">
							<span class="block m-t-xs">
								<strong class="font-bold">{{session('token')['realname']}}</strong>
								<b class="caret"></b>
							</span>
						</span>
					</a>
					<ul class="dropdown-menu animated fadeInRight">
						<li>
							<a href="{{url('admin/profile/profile')}}"><i class="fa fa-user"></i> 个人资料</a>
						</li>
						<li>
							<a href="{{url('admin/profile/changepwd')}}"><i class="fa fa-key"></i> 修改密码</a>
						</li>
						<li class="divider"></li>
						<li>
							<a href="{{url('admin/logout')}}" onclick="return confirm('您确定要退出吗？');"><i class="fa fa-sign-out"></i> 退出</a>
						</li>
					</ul>
				</div>
				<div class="logo-element">睿</div>
			</li>
			<li rel="welcome">
				<a href="{{url('admin')}}"> <i class="fa fa-flag"></i>
					<span class="nav-label">欢迎您</span>
				</a>
			</li>
			@if($user->can('view'))
			<li rel="view">
				<a href="{{url('admin/view')}}">
					<i class="fa fa-cog"></i>
					<span class="nav-label">全景管理</span>
				</a>
			</li>
			@endif
			@if($user->can('news'))
			<li rel="news">
				<a href="javascript:;">
					<i class="fa fa-th-list"></i>
					<span class="nav-label">资讯管理</span>
					<span class="fa arrow"></span>
				</a>
				<ul class="nav nav-second-level">
					<li rel="1">
					@if($token['isHidden'])
						<a href="{{url('admin/newsclass')}}">栏目结构</a>
					@else
						<a href="{{url('admin/newsclass/tree-list')}}">栏目结构</a>
					@endif
					</li>
					<li rel="2">
						<a href="{{url('admin/newsinfo')}}">信息管理</a>
					</li>
					@if($user->can('system'))
					<li rel="3">
						<a href="{{url('admin/newspopedom')}}">权限分配</a>
					</li>
					@endif
				</ul>
			</li>
			@endif
			@if($user->can('link'))
			<li rel="link">
				<a href="javascript:;">
					<i class="fa fa-leaf"></i>
					<span class="nav-label">链接管理</span>
					<span class="fa arrow"></span>
				</a>
				<ul class="nav nav-second-level">
					<li rel="1">
						<a href="{{url('admin/link')}}">友情链接</a>
					</li>
					<li rel="2">
						<a href="{{url('admin/link/tag-list')}}">链接标签</a>
					</li>
				</ul>
			</li>
			@endif
			@if($user->can('siteconfig'))
			<li rel="siteconfig">
				<a href="javascript:;">
					<i class="fa fa-cog"></i>
					<span class="nav-label">站点配置</span>
					<span class="fa arrow"></span>
				</a>
				<ul class="nav nav-second-level">
					<li rel="1">
						<a href="{{url('admin/siteconfig/meta')}}">Meta 设置</a>
					</li>
					<li rel="2">
						<a href="{{url('admin/siteconfig/logo')}}">Logo 图片</a>
					</li>
				</ul>
			</li>
			@endif
			@if($user->can('system'))
			<li rel="entrust">
				<a href="javascript:;">
					<i class="fa fa-cogs"></i>
					<span class="nav-label">系统管理</span>
					<span class="fa arrow"></span>
				</a>
				<ul class="nav nav-second-level">
					<li rel="1">
						<a href="{{url('admin/role')}}">角色管理</a>
					</li>
					<li rel="2">
						<a href="{{url('admin/user')}}">用户管理</a>
					</li>
					<li rel="3">
						<a href="{{url('admin/permission')}}">权限管理</a>
					</li>
				</ul>
			</li>
			@endif
			<li rel="profile">
				<a href="javascript:;">
					<i class="fa fa-user"></i>
					<span class="nav-label">个人管理</span>
					<span class="fa arrow"></span>
				</a>
				<ul class="nav nav-second-level">
					<li rel="1">
						<a href="{{url('admin/profile/profile')}}">基本资料</a>
					</li>
					<li rel="2">
						<a href="{{url('admin/profile/changepwd')}}">修改密码</a>
					</li>
					<li rel="3">
						<a href="{{url('admin/userfiles')}}">文 件 柜</a>
					</li>
				</ul>
			</li>
		</ul>
	</div>
</nav>